package com.luoye.unionlotto;

import java.util.List;

public class UnionlottoFromNetAnalyzer extends UnionlottoAnalyzer{
    private UnionlottoFromNetGetter unionlottoFromNetGetter;
    private UnionlottoToFileWriter unionlottoToFileWriter;

    public UnionlottoFromNetAnalyzer(String url, String dataDir) {
        super();
        this.unionlottoFromNetGetter=new UnionlottoFromNetGetter(url);
        this.unionlottoToFileWriter=new UnionlottoToFileWriter(dataDir);
    }

    public void analyze(){
        this.unionlottoList=this.unionlottoFromNetGetter.get(null);
        //写文件
        this.unionlottoToFileWriter.write(this.unionlottoList);

        //预测方法1
        List<Unionlotto> result1=this.fullMaxAndMin();
        //预测方法2
        List<Unionlotto> result2=this.randMaxAndMin();
        //预测方法3
        List<Unionlotto> result3=this.sumOneByOne();

        //数据结果
        System.out.println("");
        System.out.println("");
        printResult(result1);
        printResult(result2);
        printResult(result3);
    }
}
